package org.yangspring;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * Created by Frankie Yang on 2017/11/21.
 */
public class FrankieServletContextListener implements ServletContextListener {

    private static final Log logger = LogFactory.getLog(FrankieServletContextListener.class);

    public void contextDestroyed(ServletContextEvent event) {
        System.out.println("*************destroy ContextListener*************");
    }

    @SuppressWarnings("unused")
    public void contextInitialized(ServletContextEvent event) {
        System.out.println("*************init ContextListener*************");
        ServletContext servletContext = event.getServletContext();
        System.out.println("key:" + servletContext.getInitParameter("key"));

        System.out.println("ServerInfo:" + servletContext.getServerInfo());

    }
}
